package cn.itcast.config;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 用java写配置,代替配置文件
 * @author 16604
 *
 */
@Configuration
//开启注解扫描,扫描可以开启多个
@ComponentScan(basePackages= {"cn.itcast.beans","cn.itcast.beans2"})
public class AppContext {
	
	//如何让spring容器创建和管理第三方jar包里面得类
	@Bean
	public DateFormat createDateFormatBean() {
		return new SimpleDateFormat("yyyy-MM-dd");
		
	}
	
}
